<template>

    <el-menu style="min-height: 100%; overflow: hidden;"
              background-color="#6f5a7a"
              text-color="#fff"
              active-text-color="#ffd04b"
              :collapse-transition="false"
              :collapse="isCollapse"
              @select="handleMenuSelect"
              :default-active="this.activeIndex+''"
    >
      <div style="height: 60px; line-height: 60px; text-align: center;">
        <!-- <img src="../assets/logo.png" alt="" style="width: 30px; position: relative; top:5px; margin-right: 5px;"> -->
        <b style="color:white;" v-show="textShow">物业管理系统后台</b>
      </div>

      <el-menu-item index="0" ref="home">
        <i class="el-icon-menu"></i>
        <span slot="title">首页</span>
      </el-menu-item>

      <el-submenu index="#1" v-if="functionMenu.charAt(1) == 1 || functionMenu.charAt(2) == 1">
      <!-- <el-submenu index="#1"> -->
        <template slot="title">
          <i class="el-icon-setting"></i>
          <span slot="title">系统管理</span>
        </template>
        <el-menu-item index="1" v-if="functionMenu.charAt(1) == 1">员工管理</el-menu-item>
        <el-menu-item index="2" v-if="functionMenu.charAt(2) == 1">角色管理</el-menu-item>
      </el-submenu>


      <el-submenu index="#2" v-if="functionMenu.charAt(3) == 1 || functionMenu.charAt(4) == 1">
        <template slot="title">
          <i class="el-icon-chat-line-round"></i>
          <span slot="title">小区通知</span>
        </template>
        <el-menu-item index="3" v-if="functionMenu.charAt(3) == 1">全部通知</el-menu-item>
        <el-menu-item index="4" v-if="functionMenu.charAt(4) == 1">发布通知</el-menu-item>
      </el-submenu>


      <el-submenu index="#3" v-if="functionMenu.charAt(5) == 1">
        <template slot="title">
          <i class="el-icon-user"></i>
          <span slot="title">业主管理</span>
        </template>
        <el-menu-item index="5" v-if="functionMenu.charAt(5) == 1">业主档案</el-menu-item>
      </el-submenu>

      <el-submenu index="#4" v-if="functionMenu.charAt(6) == 1">
        <template slot="title">
          <i class="el-icon-s-open"></i>
          <span slot="title">投诉建议</span>
        </template>
        <el-menu-item index="6" v-if="functionMenu.charAt(6) == 1">投诉工单</el-menu-item>
      </el-submenu>

      <el-submenu index="#5" v-if="functionMenu.charAt(7) == 1">
        <template slot="title">
          <i class="el-icon-phone-outline"></i>
          <span slot="title">小区挪车</span>
        </template>
        <el-menu-item index="7" v-if="functionMenu.charAt(7) == 1">挪车请求</el-menu-item>
      </el-submenu>

      <el-submenu index="#6" v-if="functionMenu.charAt(8) == 1 || functionMenu.charAt(9) == 1">
        <template slot="title">
          <i class="el-icon-office-building"></i>
          <span slot="title">房产档案</span>
        </template>
        <el-menu-item index="8" v-if="functionMenu.charAt(8) == 1">全部房产</el-menu-item>
        <el-menu-item index="9" v-if="functionMenu.charAt(9) == 1">房产绑定</el-menu-item>
      </el-submenu>

      <el-submenu index="#7" v-if="functionMenu.charAt(10) == 1 || functionMenu.charAt(11) == 1">
        <template slot="title">
          <i class="el-icon-chicken"></i>
          <span slot="title">宠物档案</span>
        </template>
        <el-menu-item index="10" v-if="functionMenu.charAt(10) == 1">全部宠物</el-menu-item>
        <el-menu-item index="11" v-if="functionMenu.charAt(11) == 1">创建档案</el-menu-item>
      </el-submenu>

      <el-submenu index="#8" v-if="functionMenu.charAt(12) == 1">
        <template slot="title">
          <i class="el-icon-knife-fork"></i>
          <span slot="title">装修登记</span>
        </template>
        <el-menu-item index="12" v-if="functionMenu.charAt(12) == 1">全部装修</el-menu-item>
      </el-submenu>

      <el-submenu index="#9" v-if="functionMenu.charAt(13) == 1">
        <template slot="title">
          <i class="el-icon-fork-spoon"></i>
          <span slot="title">维修维护</span>
        </template>
        <el-menu-item index="13" v-if="functionMenu.charAt(13) == 1">全部工单</el-menu-item>
      </el-submenu>

      <el-submenu index="#10" v-if="functionMenu.charAt(14) == 1 || functionMenu.charAt(15) == 1">
        <template slot="title">
          <i class="el-icon-shopping-cart-1"></i>
          <span slot="title">车辆档案</span>
        </template>
        <el-menu-item index="14" v-if="functionMenu.charAt(14) == 1">全部车辆</el-menu-item>
        <el-menu-item index="15" v-if="functionMenu.charAt(15) == 1">车辆建档</el-menu-item>
      </el-submenu>

      <el-submenu index="#11" v-if="functionMenu.charAt(16) == 1">
        <template slot="title">
          <i class="el-icon-s-custom"></i>
          <span slot="title">访客通行</span>
        </template>
        <el-menu-item index="16" v-if="functionMenu.charAt(16) == 1">全部访客</el-menu-item>
      </el-submenu>
    </el-menu>
</template>

<script>
export default {
    name:'Aside',
    data(){
      return{
        // functionMenu:[]
      }
    },
    props:{
        isCollapse: Boolean,
        textShow: Boolean,
        handleMenuSelect: Function,
        activeIndex: Number,
        functionMenu:Array
    },
    created(){  
      // this.getData()
    },
    methods:{
      // getData(){
      //       this.$request.get("/role/authority-all",{
      //           params:{
      //           id:JSON.parse(localStorage.getItem("admin")).id
      //           }
      //       }).then(res => {
      //             this.functionMenu = res.data
      //       }).catch(err => {
      //           console.log(err)
      //       })
      // },

    },
   
   
}
</script>

<style>
</style>